<include file="../../../../../themes/admin_simpleboot3/public@header"/>
<link rel="stylesheet" type="text/css" href="/plugins/modulepara/configdata/css/moduleindex.min.css"/>
<style>.wellSearch .title,.wellSearch>span{ display:inline-block; border:1px solid #ddd; height:34px; vertical-align:top; padding:0 12px; line-height:34px; background:#dbeef9; font-weight:bold; border-radius:4px;}.searchBtn{ display:inline-block;}</style>
<if condition="$configinfo['modulename']">
    <php>if(iffile(MODULEPARA_PATH."/configdata/backend/list_".$configinfo['modulename'].".css") == 1){</php>
        <link href="/plugins/modulepara/configdata/backend/list_{$configinfo['modulename']}.css" rel="stylesheet">
    <php>}</php>
    <php>if(iffile($configinfo['tplurl']."/configdata/backend/tpl_list_".$configinfo['modulename'].".css") == 1){</php>
    	<link href="/themes/{$configinfo['tplname']}/model/configdata/backend/tpl_list_{$configinfo['modulename']}.css" rel="stylesheet">
    <php>}</php>
</if>
</head>
<body>
<div class="wrap js-check-wrap">
	<if condition="empty($_MGPC_GET['listattrid'])"><!--// 【模块参数后台程序模板安装】限制扩展列表关联参数操作其它资讯-->
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">
        所有<if condition="iszdyblockconfig() == 1"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->配置<else>资讯</if>
        </a></li>
        <if condition="iszdyblockconfig() == 2 || $configinfo['adminid'] == 1"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
        <php>
        // 【模块参数后台程序模板安装】反馈模块配置
        if($configinfo['topmodule']['feedbackok'] != 1){
        </php>
        <li><a href="/portal/admin_article/add.html{$configinfo.moreurl}">
        添加<if condition="iszdyblockconfig() == 1"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->配置<else>资讯</if>
        </a></li>
        <php>}</php>
        </if>
        <if condition="$_MGPC_GET['backOk'] == 1">
        <li>
            <a href="javascript:history.back(-1);"><i class="fa fa-reply"></i> 返回</a>
        </li>
        </if>
    </ul>
	<if condition="$otherinfoconfig['langtab'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
    {$hook_list_listlang}<!--// 【模块参数后台程序模板安装】多语言配置-->
	</if>
    <if condition="iszdyblockconfig() == 2"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
    <form class="well wellSearch form-inline margin-top-20" method="post" action="{:url('AdminArticle/index')}">
        <span class="title">分类</span>
        <select class="form-control" name="category" style="width: 140px;">
            <option value="{$configinfo['moduleid']}">{$configinfo['moduleinfo']['name']}</option>
            {$category_tree|default=''}
        </select> &nbsp;&nbsp;
        <if condition="$otherinfoconfig['search_time'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
        <span class="title">时间</span>
        <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
               value="{$start_time|default=''}"
               style="width: 140px;" autocomplete="off">-
        <input type="text" class="form-control js-bootstrap-datetime" name="end_time"
               value="{$end_time|default=''}"
               style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
        </if>
        <span class="title">关键字</span>
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入关键字..."> &nbsp;&nbsp;
        <div class="searchBtn">
            <input type="submit" class="btn btn-primary" value="搜索"/>
            <a class="btn btn-danger" href="{:url('AdminArticle/index')}">清空</a>
        </div>
        
        {$hook_list_listsearch}<!--// 【模块参数后台程序模板安装】列表参数搜索-->
    </form>
    </if>
    </if>
    <form class="js-ajax-form" action="" method="post">
        <if condition="iszdyblockconfig() == 1"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
			<style>
				.blockConfigList{ margin-top:20px;}
                .blockConfigList dl{ border:1px solid #ddd; border-radius:8px; padding:30px 20px; position:relative; margin:0;}
				.blockConfigList dl:after { content:""; background:#f8f8f8 url(__TMPL__/public/assets/images/config-bg.png) no-repeat right bottom; z-index:-1; position:absolute; left:0; top:0; bottom:0; right:0;}
				.blockConfigList dl dd .btn-xs{ padding: 8px 16px; font-size: 18px; line-height: 1.3333333; border-radius: 6px; margin-right:10px;}
				.blockConfigList dl dd ul{ margin:0; padding:0; list-style:none;}
				.blockConfigList dl dd ul li{ margin:10px 0;}
				.blockConfigList dl dd ul li font{ display:inline-block; width:80px; text-align:right; margin-right:5px;}
            </style>
            <foreach name="articles" item="vo">
            <div class="blockConfigList">
                <dl class="st-flexBlock st-posr">
                	<dt class="st-wid20 st-imgBox"><img class="st-borr8" src="__TMPL__/public/assets/images/config{$key+1}.png" /></dt>
                    <dd class="st-wid30 st-pl15 st-flexBox st-fleboxtb">
                    	<ul>
                        	<li><font class="status-text-gray">配置ID：</font><span>{$vo.id}</span></li>
                            <li><font class="status-text-gray">排序：</font><span>
                            <input name="list_orders[{$vo.id}]" class="input-order" type="text"
                                   value="{$vo.list_order}"></span></li>
                        	<li><font class="status-text-gray">配置名称：</font><span class="st-fon18 st-fonb status-text-red">{$vo.post_title}</span></li>
                            <li><font class="status-text-gray">所属栏目：</font><span>{$vo.category_name}</span></li>
                            <li><font class="status-text-gray">配置权限：</font>
                                <if condition="$vo['systemok'] == 2">
                                    <span class="label label-success">模板配置</span>
                                <elseif condition="$vo['systemok'] == 1">
                                    <span class="label label-danger">系统配置</span>
                                </if>
                            </li>
                            <li><font class="status-text-gray">更新时间：</font><span>{:date('Y-m-d H:i',$vo['update_time'])}</span></li>
                        </ul>
                    </dd>
                    <dd class="st-wid50 st-flexBox st-fleboxr st-fleboxtb" style="padding-right:150px;">
                    	<div class="st-block">
                    	<a class="btn btn-warning btn-xs" href="/portal/admin_article/edit/id/{$vo['id']}.html{$configinfo.moreurl}">点击设置</a>
                        {$vo.hook_list_attrinfo}<!--// 【模块参数后台程序模板安装】列表关联参数-->
                        </div>
                    </dd>
                </dl>
            </div>
            </foreach>
        <else/>
        <div class="table-actions">
        	<if condition="iszdyblockconfig() == 2"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
            <notempty name="category">
                <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                        data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}
                </button>
            </notempty>
            <button class="btn btn-primary btn-sm js-ajax-submit post_status" type="submit"
                    data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">{$listdeffield.post_statusname}
            </button>
            <button class="btn btn-warning btn-sm js-ajax-submit post_status" type="submit"
                    data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消{$listdeffield.post_statusname}
            </button>
            </if>
            <if condition="$otherinfoconfig['post_statusok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
            <button class="btn btn-warning btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶
            </button>
            <button class="btn btn-warning btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐
            </button>
          	</if>
            <!--
            <notempty name="category">
                <button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>
            </notempty>
            <button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>
            -->
            <if condition="iszdyblockconfig() == 2"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
            <button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminArticle/delete')}" data-subcheck="true" data-msg="您确定删除吗？">
                {:lang('DELETE')}
            </button>
            </if>
            <input type="hidden" name="category" value="{$_MGPC_REQ['category']}">
            <!--// 【模块参数后台程序模板安装】模块参数全局提交参数-->
            <php>if(!empty($_MGPC_REQ['attrid'])){</php><input type="hidden" name="attrid" value="<php>echo $_MGPC_REQ['attrid'];</php>" /></notempty><php>}</php>
            <php>if(!empty($_MGPC_REQ['lang'])){</php><input type="hidden" name="lang" value="<php>echo $_MGPC_REQ['lang'];</php>" /><php>}</php>
            <php>if(!empty($_MGPC_REQ['morepara'])){</php><input type="hidden" name="morepara" value="<php>echo $_MGPC_REQ['morepara'];</php>" /><php>}</php>
            <div class="batchOp_right" style="float:right;">
            	<a href="{:url('admin/RecycleBin/index')}?backOk=1" title="回收站" data-toggle="tooltip">
                    <i class="fa fa-recycle"></i> 查看回收站
                </a>
            </div>
            <div style="clear:both"></div>
        </div>
        <style>
			.table .am-grid-fixed-right{
				height: auto;
				z-index: 1011;
				position: sticky;
				background: #fff;
				max-width: 250px;
				width:auto;
				right: 0px;
				-webkit-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
				-moz-box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
				box-shadow: -5px 0px 10px rgba(136, 136, 136, 0.3);
			}
			.table th.am-grid-fixed-right{
				background: #dfe5ea;
			}
        	.table-scrollable{ border:1px solid #ddd;}
			.table-scrollable>table{ border:none;}
			.table-scrollable>table>thead>tr>th:first-child{ border-left:none!important;}
			.table-scrollable>table>tbody>tr>td:first-child{ border-left:none!important;}
			.table-scrollable>table>thead>tr>th:last-child{ border-right:none!important;}
			.table-scrollable>table>tbody>tr>td:last-child{ border-right:none!important;}
        </style>
        <div class="table-responsive table-scrollable">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="80" style="min-width:80px;">
                    <label style="margin-bottom:0;">
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                    ID
                </th>
                <th width="50" style="min-width:50px;">{:lang('SORT')}</th>
                <if condition="$listdeffield['thumbnailok'] == 1 || $toptype == '自定义栏目' || $toptype == '自定义单页'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                <th width="80" style="min-width:80px;">{$listdeffield.thumbnailname}</th>
                </if>
                <th style="min-width:350px;"><if condition="iszdyblockconfig() == 1 && $listdeffield.titlename == '资讯标题'"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->配置名称<else>{$listdeffield.titlename}</if></th>
                <th width="120" style="min-width:120px;">分类</th>
				<if condition="iszdyblockconfig($configinfo['moduleid']) == 1 && $configinfo.adminid == 1">
				<th width="120" style="min-width:120px;">配置权限</th>
				</if>
				<foreach name="parameteradmin" item="vo">
                <th width="{$vo.width}" style="min-width:{$vo.width}px;">{$vo.name}</th>
                </foreach>
                <if condition="$listdeffield['user_nicknameok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                <th width="80" style="min-width:80px;">{$listdeffield.user_nicknamename}</th>
                </if>
                <if condition="$listdeffield['post_hitsok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                <th width="65" style="min-width:65px;">{$listdeffield.post_hitsname}</th>
                </if>
                <if condition="$listdeffield['published_timeok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                <th width="180" style="min-width:180px;">{$listdeffield.published_timename}</th>
                </if>
                <if condition="iszdyblockconfig() == 2"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
                <th class="post_status" width="70" style="min-width:70px;">状态</th>
                </if>
                <th width="250" style="min-width:250px;" class="am-grid-fixed-right">操作</th>
            </tr>
            </thead>
            <foreach name="articles" item="vo">
                <tr class="datalist">
                    <td>
                        <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                               value="{$vo.id}" title="ID:{$vo.id}">
                        {$vo.id}
                    </td>
                        <td>
                            <input name="list_orders[{$vo.id}]" class="input-order" type="text"
                                   value="{$vo.list_order}">
                        </td>
                    <if condition="$listdeffield['thumbnailok'] == 1 || $toptype == '自定义栏目' || $toptype == '自定义单页'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                    <td><notempty name="vo.thumbnail"><img src="{:cmf_get_image_preview_url($vo['thumbnail'])}" width="60" height="60" /><else/><img src="__TMPL__/public/assets/images/default-thumbnail.png" width="60" height="60" /></notempty></td>
                    </if>
                    <td class="fx-list-title">
                        <a class="listtitle" href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$vo['category_id']))}"
                           target="_blank">{$vo.post_title}</a>
                    </td>
                    <td>
                        <a class="label label-default" href="{:cmf_url('portal/List/index',array('id'=>$vo['category_id']))}" target="_blank">{$vo.category_name}</a>
                    </td>
					<if condition="iszdyblockconfig($configinfo['moduleid']) == 1 && $configinfo.adminid == 1">
					<td>
						<if condition="$vo['systemok'] == 2">
							<span class="label label-success">模板配置</span>
						<elseif condition="$vo['systemok'] == 1">
							<span class="label label-danger">系统配置</span>
						</if>
					</td>
					</if>
                    {$vo.hook_list_paralist}<!--// 【模块参数后台程序模板安装】列表参数-->
                    <if condition="$listdeffield['user_nicknameok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                    <td>{$vo.user_nickname}</td>
                    </if>
                    <if condition="$listdeffield['post_hitsok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                    <td>{$vo.post_hits|default=0}</td>
                    </if>
                    <if condition="$listdeffield['published_timeok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                    <td>
                        <empty name="vo.published_time">
                            未{$listdeffield.post_statusname}
                            <else/>
                            {:date('Y-m-d H:i',$vo['published_time'])}
                        </empty>

                    </td>
                    </if>
                    <if condition="iszdyblockconfig() == 2"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
                    <td class="post_status">
                        <notempty name="vo.post_status">
                            <a data-toggle="tooltip" title="已{$listdeffield.post_statusname}"><i class="fa fa-check"></i></a>
                            <else/>
                            <a data-toggle="tooltip" title="未{$listdeffield.post_statusname}"><i class="fa fa-close"></i></a>
                        </notempty>
                        <if condition="$listdeffield['post_statusok'] == 1 || $toptype == '自定义栏目'"><!--// 【模块参数后台程序模板安装】模块参数默认字段开启配置-->
                        <notempty name="vo.is_top">
                            <a data-toggle="tooltip" title="已置顶"><i class="fa fa-arrow-up"></i></a>
                            <else/>
                            <a data-toggle="tooltip" title="未置顶"><i class="fa fa-arrow-down"></i></a>
                        </notempty>
                        <notempty name="vo.recommended">
                            <a data-toggle="tooltip" title="已推荐"><i class="fa fa-thumbs-up"></i></a>
                            <else/>
                            <a data-toggle="tooltip" title="未推荐"><i class="fa fa-thumbs-down"></i></a>
                        </notempty>
                        </if>
                    </td>
                    </if>
                    <td class="am-grid-fixed-right">
                        <a class="btn btn-xs btn-primary" href="/portal/admin_article/edit/id/{$vo['id']}.html{$configinfo.moreurl}">
                        <php>
                        // 【模块参数后台程序模板安装】反馈模块配置
                        if($configinfo['topmodule']['feedbackok'] == 1){
                        </php>
                        处理
                        <php>}else{</php>
                        {:lang('EDIT')}
                        <php>}</php>
                        </a>
                        <if condition="iszdyblockconfig() == 2"><!--// 【模块参数后台程序模板安装】是否系统资讯删除权限判断-->
                        <a href="/portal/admin_article/delete/id/{$vo['id']}.html{$configinfo.moreurl}" class="btn btn-xs btn-danger js-ajax-delete">{:lang('DELETE')}</a>
                        </if>
                        
                         {$vo.hook_list_attrinfo}<!--// 【模块参数后台程序模板安装】列表关联参数-->
                    </td>
                </tr>
                {$vo.hook_list_listdatahtml}<!--// 【模块参数后台程序模板安装】列表资讯HTML-->
            </foreach>
        </table>
        </div>
        {$hook_list_listexphtml}<!--// 【模块参数后台程序模板安装】列表扩展资讯HTML-->
        </if>
        <div class="pages" style="text-align:center;">
        	<ul class="pagination">{$page|default=''}</ul>
        </div>
    </form>
</div>
<script type="text/javascript" src="/plugins/styleplugins/js/styleplugins.min.js"></script>
<script type="text/javascript" src="/plugins/modulepara/configdata/js/moduleindex.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/vue.min.js"></script>
<script src="__STATIC__/js/admin.js"></script>
<script>

    function reloadPage(win) {
        win.location.reload();
    }

    $(function () {
        setCookie("refersh_time", 0);
        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
            //批量复制
            $('.js-articles-copy').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
                    title: "批量复制",
                    width: "300px"
                });
            });
            //批量移动
            $('.js-articles-move').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
                    title: "批量移动",
                    width: "300px"
                });
            });
        });
    });
</script>
<if condition="$configinfo['modulename']">
	<php>if(iffile(MODULEPARA_PATH."/configdata/backend/list_".$configinfo['modulename'].".js") == 1){</php>
		<script type="text/javascript" src="/plugins/modulepara/configdata/backend/list_{$configinfo['modulename']}.js"></script>
    <php>}</php>
	<php>if(iffile($configinfo['tplurl']."/configdata/backend/tpl_list_".$configinfo['modulename'].".js") == 1){</php>
		<script type="text/javascript" src="/themes/{$configinfo['tplname']}/model/configdata/backend/tpl_list_{$configinfo['modulename']}.js"></script>
    <php>}</php>
</if>

</body>
</html>